<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fun"%>   
<html>
<head>
    <title>提现</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <link href="${pageContext.request.contextPath}/static/css/common.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/layer/skin/layer.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/css/bootstrap.min.css"
          rel="stylesheet">
          <link href="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/css/select2.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/static/plugins/font-awesome-4.3.0/css/font-awesome.min.css"
          rel="stylesheet">
          <link rel="stylesheet" href="${pageContext.request.contextPath}/static/plugins/jquery.time/jquery.timepicker.min.css">
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <script src="/static/plugins/bootstrap-3.3.5/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/plugins/layer/layer.js" type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/static/plugins/select2-4.0.0/dist/js/select2.min.js"></script>
	<script src="${pageContext.request.contextPath}/static/plugins/My97DatePicker/WdatePicker.js"
        type="text/javascript"></script>
	<script src="${pageContext.request.contextPath}/static/plugins/jquery.time/jquery.timepicker.min.js"
        type="text/javascript"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/global.js"></script>
	<style type="text/css">
	*{margin:0;padding:0;}
	.wraper{
		padding:0px 0px;
	}
	.content{
		padding:10px 3%;
	}
	.col-md-1{
		text-align:right;
	}
	.btn{
		width:110px;
		padding: 5px 0;
		border:1px solid #c8edff;
	} 
	.content .row{
		padding:10px 0;
	}
	.box{
		padding:20px 0px 10px;
		
	}
	.box ol{
		padding-left:14px;
		line-height:20px;
	}
	.txt{
		color:#333;
		font-size:14px;
		margin-right:70px;
		line-height:30px;
	}
	.txt input{
	   display:inline-block;
	   height:30px;
	   *+height:22px;
	   margin-right:5px;
	   vertical-align: middle;
	   
	}
	.titles{
		font-size:20px;
		*+font-size:18px;
		color:#333;
		overflow:hidden;
		width:100%;
		padding:5px 20px;
		background:#f8f8f8;
		
	}
	.titles .span1{
		float: left;
	}
	.titles .span2{
		float:right;
	}
	.lt{
		float:left;
	}
	.cearfix{
		overflow:hidden;
	}
	.msg{
		border-bottom:1px solid #ccc;
		padding-bottom:20px;
	}
	.box li{
		line-height:50px;
		font-size:18px;
		font-weight: normal;
	}
	.btn button{
		height: 30px;
	    line-height: 26px;
	    background: none;
	    border: none;
	    outline: none;
	}
	.pays{
		padding-left:120px;
	}
	.pays .pay{
	  width:160px;
	  height:50px;
	  *+line-height:38px;
	  outline: none;
	}
	.btn-primary{
		background:#228ded !important;
		border-color:#228ded !important;
		font-size:20px !important;
	}
	.box label{
		width:100px;
		margin-right:40px;
	}
	.limit{
		display:inline-block;
		width:360px;
		padding-left:20px;
	}
	.checkbox{
		display:inline-block;
		width:20px;
		height:20px;
		margin-right: 20px;
		border:1px solid #ccc;
		
	}
	.box li {
		margin: 2px;
		height: 67px;
		line-height: 66px;
		font-size:20px;
		padding:0 20px;
	}
	.box li lt{
		display:inline-block;
	}
	.box li img{
		vertical-align: middle;
		padding-left:20px;
	}
	.images{
	   height:48px;
	   height:48px\0;
	   padding:8px 2px;
	   padding:10px\0/;
	   text-align:center;
	   
	}
	.glyphicon{
		top:1px;
		top:-3px\0/;
		font-size:14px;
		font-size:20px\0/;
	}
	.glyphicon-ok{
		color:#f36875;
		font-weight:400;
	}
	#box  .red{
		border-color:#f36875;
	}
	#box .border{
	
		border:2px #c8edff solid;
	}
	.hid{
		padding-left: 24px;
		font-size: 16px;
		color: #666;
	}
	.hid input{
		width:160px;
		height:40px;
		display:inline-block;
		margin-bottom:20px;
		margin-left:18px;
		padding:0 6px;
		font-size: 16px !important;
		border: 1px solid #dddddd;
	}
	#box .block{
		display:block;
	}
	.hid a{
		color:#2ea7e7;
	}
	p{margin:0;}
	label i {
				font-size: 12px;
				font-style: normal;
				display: inline-block;
				width: 14px;
				height: 14px;
				text-align: center;
				line-height: 12px;
				color: #fff;
				vertical-align: middle;
				margin: -2px 10px 1px 0px;
				border: #b5b5b5 1px solid;
			}
			
			input[type="checkbox"],
			input[type="radio"] {
				display: none;
			}
			input[type="checkbox"]:checked+i,
			input[type="radio"]:checked+i {
				color:#f36371;
				border-color:#f36371;
			}
			.box .labels{
				margin:0;width:100%;font-size:20px;font-weight:500;
			}
			.spans{
				display:inline-block;
				width：90px;
			}
	</style>
<body>
<div class="wraper">
 	 <!-- <div class="titles"> 
	 	 <div class="span1">
	 	  <div class="cearfix">
		  	<p class=" lt" style="width:100px;">提现 </p>
	  	 </div>
	 	 </div> 
	 	 <div class="span2">x</div>
 	 </div> -->
	 <div class="content"> 
	  <div class="cearfix" style="margin-bottom:7px;font-size:16px;display:inline-block;height:50px;margin-left: 24px;">
	  	选择提现至：
	  </div>
	 
	  <div class="box" style="display:inline-block;width:600px;" id="box">
	  <ul style="position:relative;">
	  	<li data-departid='10001' class="border">
	  		<!--<span class="checkbox lt"><span class="glyphicon"></span></span>-->
	  		<label class="labels"><input type="checkbox" checked="true"><i>✓</i>支付宝
				<span style="display:inline-block;">
					<img src="${pageContext.request.contextPath}/static/images/admin/wallet/zfb.jpg"/>
				</span>
		  	</label>
	  	</li>
<%-- 	  
 	  	<li>
		  <span class="checkbox lt"><span class="glyphicon"></span></span>
		  <span style="width:80px;display:inline-block;">微信</span>
		  <span style="display:inline-block;padding:0px 0;">
		  	<img src="${pageContext.request.contextPath}/static/images/admin/wallet/wx.jpg" />
		  </span>
		  	
		  	
	  	</li>
	  	<li>
		  <span class="checkbox lt"><span class="glyphicon"></span></span>
		 	 <span style="width:80px;display:inline-block;">银行卡</span>
		 	  <span style="display:inline-block;">
		  	 	<img src="${pageContext.request.contextPath}/static/images/admin/wallet/yh.jpg" alt=""/>
		  	 	
		  	 </span>
		 	 <select id="sele">
		 	 	<option>
		 	 		<span style="font-size:12px;" >农业银行 储蓄卡（8611）|单笔限额5千</span>
		 	 	</option>
		 	 </select>
		  	
		  	 	
		  	 
	  	</li>
	  	<div class="btn" style="position:absolute;top:110px;top:108px\9;*+top:120px;left:700px;">
		  		<button style="color:#85b1dc !important;">+添加新卡</button>
		  </div> --%>
	  </ul>
	  		
	  </div>
	 <br/>
	 <div class="hid">
	 	 <span class="spans">支付宝账号:</span></span><input type="text" placeholder="请输入支付账号" id='payee_account' /><br/>
	 	 <span class="spans">账户姓名：</span><input type="text" placeholder="请输入真实姓名" id='payee_real_name'/><br/>
	 	 <span class="spans">提现金额：</span><input type="text" placeholder="请输入要体现的金额" id='amount'/> 元（可用余额：<font style="color: red;">${amount}</font>元）<br/> 
	 	 <span class="spans">支付密码：</span><input type="password" placeholder="请输入支付密码" id='payPassword' autocomplete="off"/>
	 	 <a  onclick="window.open('${pageContext.request.contextPath}/admin/userWallet_payPasswordView.action','_blank')" >
	 	 	<c:if test="${payPasswordState == 1}">
	 	 	设置平台交易密码
	 	 	</c:if>
	 	 	<c:if test="${payPasswordState != 1}">
	 	 	忘记支付密码？
	 	 	</c:if>
	 	 </a>
	 </div>
	  <div class="pays"><button class="btn btn-primary pay" value="" onclick="rollOut()"/>确定</button></div>
	 </div>
</div>
<script type="text/javascript">
var index=parent.layer.index;
parent.layer.style(index, {
                        height: 500
                     });
//parent.layer.iframeAuto(parent.layer.index);
  var $li=$("#box li");
  var departid='10001';
 
  $li.click(function(){
	 $(this).addClass("border").siblings().removeClass("border");
	 $(this).find(".checkbox").addClass("red");
	 $(this).find(".glyphicon").addClass("glyphicon-ok");
	 $(this).siblings().find(".glyphicon").removeClass("glyphicon-ok");
	 $(this).siblings().find(".checkbox").removeClass("red");
	 departid = $(this).attr("data-departid");
	
  });
  $li[0].onclick=function(){
		 $(".hid")[0].style.display="block";
	};
 $li[1].onclick=function(){
		 $(".hid")[0].style.display="none";
 };
 $li[2].onclick=function(){
	 $(".hid")[0].style.display="block";
 };
  $("#sele").select2({
	  "minimumResultsForSearch":-1
  })
  
  function rollOut(){
	  var payee_account  = $("#payee_account").val();
	  var payee_real_name = $("#payee_real_name").val();
	  var amount = $("#amount").val();
	  var payPassword = $("#payPassword").val();
	  if(payee_account==''){
		  layer.msg('请填写支付宝账号');
		  return;
	  }
	  if(payee_real_name==''){
		  layer.msg('请填写账户姓名');
		  return;
	  }
	  if(amount==''){
		  layer.msg('请填写提现金额');
		  return;
	  }
	  if(payPassword==''){
		  layer.msg('请填写支付密码');
		  return;
	  }
	  if(amount<0.1||amount>50000){
		  layer.msg('请填写提现金额0.1-50000元以内');
		  return;
	  }
	  if(departid==''){
		  layer.msg('请填写支付方式');
		  return;
	  }
	  layer.open({type: 3})
	  
	   $.ajax({
	        type: "POST",
	        url: '/admin/userWallet_rollOut.action',
	        data: 'payPassword='+payPassword+"&amount="+amount+"&departid="+departid+"&payee_account="+payee_account+"&payee_real_name="+payee_real_name,
	        success: function (data) {
	            data = eval("(" + data + ")");
	            layer.closeAll('loading');
	            if(data.code=='1'){
	            	if(departid=='10001'){
					    parent.window.location = '${pageContext.request.contextPath}/admin/userWallet_rollOutSuccess.action';     		
	            	}else{
	            		layer.alert('提现成功');	
	            	}
	            	
	            }else{
	            	layer.alert(data.msg);	
	            }
	        }
		 });
  }
</script>
</body>
</html>
